home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / bbs_util / bsrc_260.zip / SRC.ZIP / B_SBINIT.C < prev    next >
C/C++ Source or Header  |  1996-02-21  |  7KB  |  164 lines

  1. /*--------------------------------------------------------------------------*/
  2. /*                                                                          */
  3. /*                                                                          */
  4. /*      ------------         Bit-Bucket Software, Co.                       */
  5. /*      \ 10001101 /         Writers and Distributors of                    */
  6. /*       \ 011110 /          Freely Available<tm> Software.                 */
  7. /*        \ 1011 /                                                          */
  8. /*         ------                                                           */
  9. /*                                                                          */
  10. /*              (C) Copyright 1987-96, Bit Bucket Software Co.              */
  11. /*                                                                          */
  12. /*            This module was originally written by Bob Hartman             */
  13. /*                                                                          */
  14. /*                  BinkleyTerm Initial Fullscreen Setup                    */
  15. /*                                                                          */
  16. /*                                                                          */
  17. /*    For complete  details  of the licensing restrictions, please refer    */
  18. /*    to the License  agreement,  which  is published in its entirety in    */
  19. /*    the MAKEFILE and BT.C, and also contained in the file LICENSE.260.    */
  20. /*                                                                          */
  21. /*    USE  OF THIS FILE IS SUBJECT TO THE  RESTRICTIONS CONTAINED IN THE    */
  22. /*    BINKLEYTERM  LICENSING  AGREEMENT.  IF YOU DO NOT FIND THE TEXT OF    */
  23. /*    THIS  AGREEMENT IN ANY OF THE  AFOREMENTIONED FILES,  OR IF YOU DO    */
  24. /*    NOT HAVE THESE FILES,  YOU  SHOULD  IMMEDIATELY CONTACT BIT BUCKET    */
  25. /*    SOFTWARE CO.  AT ONE OF THE  ADDRESSES  LISTED BELOW.  IN NO EVENT    */
  26. /*    SHOULD YOU  PROCEED TO USE THIS FILE  WITHOUT HAVING  ACCEPTED THE    */
  27. /*    TERMS  OF  THE  BINKLEYTERM  LICENSING  AGREEMENT,  OR  SUCH OTHER    */
  28. /*    AGREEMENT AS YOU ARE ABLE TO REACH WITH BIT BUCKET SOFTWARE, CO.      */
  29. /*                                                                          */
  30. /*                                                                          */
  31. /* You can contact Bit Bucket Software Co. at any one of the following      */
  32. /* addresses:                                                               */
  33. /*                                                                          */
  34. /* Bit Bucket Software Co.        FidoNet  1:104/501, 1:343/491             */
  35. /* P.O. Box 460398                AlterNet 7:42/1491                        */
  36. /* Aurora, CO 80046               BBS-Net  86:2030/1                        */
  37. /*                                Internet f491.n343.z1.fidonet.org         */
  38. /*                                                                          */
  39. /* Please feel free to contact us at any time to share your comments about  */
  40. /* our software and/or licensing policies.                                  */
  41. /*                                                                          */
  42. /*--------------------------------------------------------------------------*/
  43.  
  44. /* Include this file before any other includes or defines! */
  45.  
  46. #include "includes.h"
  47.  
  48. extern VIOMODEINFO vfos_mode;
  49.  
  50. void 
  51. b_sbinit ()
  52. {
  53.     register int r;
  54.     char *savep;
  55.  
  56.     savep = calloc (1, 4096);
  57.     for (r = 0; r < 132; r++)
  58.     {
  59.         blanks[r * 2] = ' ';
  60.         blanks[r * 2 + 1] = 7;
  61.     }
  62.  
  63.     vfossil_init ();
  64.     if (vfos_mode.col < 80)
  65.         vfos_mode.col = 80;
  66.     if (vfos_mode.row < 23)
  67.         vfos_mode.row = 23;
  68.  
  69.     SB_ROWS = vfos_mode.row - 1;
  70.     SB_COLS = vfos_mode.col;
  71.  
  72.     SB_COLS_M_1 = SB_COLS - 1;
  73.     SB_ROWS_M_1 = SB_ROWS - 1;
  74.     SB_ROWS_M_2 = SB_ROWS - 2;
  75.     SB_ROW_STATUS = SB_ROWS - 15;
  76.  
  77.     screen_clear ();
  78.     sb_init ();
  79.     free (savep);
  80.  
  81.     wholewin = (REGIONP) sb_new (0, 0, SB_ROWS, SB_COLS);
  82.     settingswin = (REGIONP) sb_new (1, 1, 7, 22);
  83.     historywin = (REGIONP) sb_new (1, 23, 7, 23);
  84.     holdwin = (REGIONP) sb_new (1, 46, 7, (short) (SB_COLS - 47));
  85.     callwin = (REGIONP) sb_new (8, 1, (short) (SB_ROWS - 13), (short) (SB_COLS - 2));
  86.     filewin = (REGIONP) sb_new ((short) (SB_ROWS - 5), 1, 4, (short) (SB_COLS - 2));
  87.  
  88.     sb_fill (wholewin, ' ', colors.background);
  89.     sb_fill (settingswin, ' ', colors.settings);
  90.     sb_fill (historywin, ' ', colors.history);
  91.     sb_fill (holdwin, ' ', colors.hold);
  92.     sb_fill (callwin, ' ', colors.call);
  93.     sb_fill (filewin, ' ', colors.file);
  94.  
  95.     sb_box (settingswin, boxtype, colors.settings);
  96.     sb_box (historywin, boxtype, colors.history);
  97.     sb_box (holdwin, boxtype, colors.hold);
  98.     sb_box (callwin, boxtype, colors.call);
  99.     sb_box (filewin, boxtype, colors.file);
  100.  
  101.     sb_caption (settingswin, MSG_TXT (M_CURRENT_SETTINGS));
  102.     sb_caption (historywin, MSG_TXT (M_TODAY_GLANCE));
  103.     sb_caption (holdwin, MSG_TXT (M_PENDING_OUTBOUND));
  104.     sb_caption (callwin, MSG_TXT (M_RECENT_ACTIVITY));
  105.     sb_caption (filewin, MSG_TXT (M_TRANSFER_STATUS));
  106.  
  107.     sb_move (holdwin, 3, 7);
  108.     sb_puts (holdwin, MSG_TXT (M_INITIALIZING_SYSTEM));
  109.  
  110.     sb_move (wholewin, 0, 1);
  111.     (void) sprintf (junk, MSG_TXT (M_NODE_COLON), Full_Addr_Str (&my_addr));
  112.     sb_puts (wholewin, junk);
  113.     sb_move (wholewin, 0, (short) (SB_COLS - 1 - (short) strlen (system_name)));
  114.     sb_puts (wholewin, system_name);
  115.  
  116.     bottom_line ();
  117.  
  118.     sb_move (settingswin, SET_EVNT_ROW, 2);
  119.     sb_puts (settingswin, MSG_TXT (M_EVENT_COLON));
  120.     sb_move (settingswin, SET_PORT_ROW, 2);
  121.     sb_puts (settingswin, MSG_TXT (M_PORT_COLON));
  122.     sb_move (settingswin, SET_STAT_ROW, 2);
  123.     sb_puts (settingswin, MSG_TXT (M_STATUS_INIT));
  124.  
  125.     do_today ();
  126.  
  127.     settingswin->sr0 = settingswin->r0 + 1;
  128.     settingswin->sr1 = settingswin->r1 - 1;
  129.     settingswin->sc0 = settingswin->c0 + 1;
  130.     settingswin->sc1 = settingswin->c1 - 1;
  131.  
  132.     historywin->sr0 = historywin->r0 + 1;
  133.     historywin->sr1 = historywin->r1 - 1;
  134.     historywin->sc0 = historywin->c0 + 1;
  135.     historywin->sc1 = historywin->c1 - 1;
  136.  
  137.     holdwin->sr0 = holdwin->r0 + 1;
  138.     holdwin->sr1 = holdwin->r1 - 1;
  139.     holdwin->sc0 = holdwin->c0 + 1;
  140.     holdwin->sc1 = holdwin->c1 - 1;
  141.  
  142.     callwin->sr0 = callwin->r0 + 1;
  143.     callwin->sr1 = callwin->r1 - 1;
  144.     callwin->sc0 = callwin->c0 + 1;
  145.     callwin->sc1 = callwin->c1 - 1;
  146.  
  147.     callwin->lines = callwin->sr1 - callwin->sr0 + 1;
  148.  
  149.     if (scrllines < callwin->lines) 
  150.         scrllines = callwin->lines;
  151.  
  152.     callwin->linesize  = callwin->sc1 - callwin->sc0 + 1;
  153.     callwin->buffer    = calloc (scrllines, callwin->linesize);
  154.     callwin->endbuff   = callwin->buffer + ((scrllines - 1) * callwin->linesize) ;
  155.     callwin->lastline  = callwin->buffer ;
  156.     callwin->lastshown = callwin->lastline ;
  157.  
  158.     filewin->sr0 = filewin->r0 + 1;
  159.     filewin->sr1 = filewin->r1 - 1;
  160.     filewin->sc0 = filewin->c0 + 1;
  161.     filewin->sc1 = filewin->c1 - 1;
  162. }
  163.  
  164.